package com.ruoyi.gis.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.gis.domain.DatasetRasterTaskLine;
import com.ruoyi.gis.service.IDatasetRasterTaskLineService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 遥感监测任务节点连接条件Controller
 * 
 * @author rww
 * @date 2024-09-21
 */
@RestController
@RequestMapping("/earthai/taskLine")
public class DatasetRasterTaskLineController extends BaseController
{
    @Autowired
    private IDatasetRasterTaskLineService datasetRasterTaskLineService;

    /**
     * 查询遥感监测任务节点连接条件列表
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:list')")
    @GetMapping("/list")
    public TableDataInfo list(DatasetRasterTaskLine datasetRasterTaskLine)
    {
        startPage();
        List<DatasetRasterTaskLine> list = datasetRasterTaskLineService.selectDatasetRasterTaskLineList(datasetRasterTaskLine);
        return getDataTable(list);
    }

    /**
     * 导出遥感监测任务节点连接条件列表
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:export')")
    @Log(title = "遥感监测任务节点连接条件", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DatasetRasterTaskLine datasetRasterTaskLine)
    {
        List<DatasetRasterTaskLine> list = datasetRasterTaskLineService.selectDatasetRasterTaskLineList(datasetRasterTaskLine);
        ExcelUtil<DatasetRasterTaskLine> util = new ExcelUtil<DatasetRasterTaskLine>(DatasetRasterTaskLine.class);
        util.exportExcel(response, list, "遥感监测任务节点连接条件数据");
    }

    /**
     * 获取遥感监测任务节点连接条件详细信息
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(datasetRasterTaskLineService.selectDatasetRasterTaskLineById(id));
    }

    /**
     * 新增遥感监测任务节点连接条件
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:add')")
    @Log(title = "遥感监测任务节点连接条件", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DatasetRasterTaskLine datasetRasterTaskLine)
    {
        return toAjax(datasetRasterTaskLineService.insertDatasetRasterTaskLine(datasetRasterTaskLine));
    }

    /**
     * 修改遥感监测任务节点连接条件
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:edit')")
    @Log(title = "遥感监测任务节点连接条件", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DatasetRasterTaskLine datasetRasterTaskLine)
    {
        return toAjax(datasetRasterTaskLineService.updateDatasetRasterTaskLine(datasetRasterTaskLine));
    }

    /**
     * 删除遥感监测任务节点连接条件
     */
    @PreAuthorize("@ss.hasPermi('earthai:taskLine:remove')")
    @Log(title = "遥感监测任务节点连接条件", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(datasetRasterTaskLineService.deleteDatasetRasterTaskLineByIds(ids));
    }
}
